package com.hema.auction.adapter;

import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hema.auction.R;
import com.hema.auction.bean.GoodsInfo;
import com.hema.auction.widget.view.IndexNewsGoodsView;

import java.util.List;

/**
 * 描述:
 * 作者:john
 */
public class NewestOrdersAdapter extends BaseQuickAdapter<GoodsInfo, BaseViewHolder> {

    public NewestOrdersAdapter(@Nullable List<GoodsInfo> data) {
        super(R.layout.layout_newest_order_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, GoodsInfo item) {
        IndexNewsGoodsView goodsView = helper.getView(R.id.newest_order);
        goodsView.setData(item);
    }

    @Override
    public int getItemCount() {
        return getData().size() > 3 ? 3 : getData().size();
    }
}
